package com.wanxi.util;

import java.util.Scanner;

public class StudentSplit {
    public static void main(String[] args) {
//        Scanner scanner=new Scanner()
        String str = "张三,11";
        String[] split = str.split(",");
        String name = split[0];
        int age = Integer.parseInt(split[1]);
//        for (int i = 0; i < str.length(); i++) {
//            if (",".equals(str.charAt(i) + "")) {
//                name = str.substring(0, i);
//                age = Integer.parseInt(str.substring(i + 1));
//                break;
//            }
//        }
        Student student = new Student(name, age);
        System.out.println(student);
    }
}
